<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Component-first</title>
    <link rel="stylesheet" href="../../../assets/css/bootstrap.min.css">
    <script src="../../../assets/js/vue-2.5.6.js"></script>
</head>

<body>
    <div id="app">
        <panda here='中国'></panda>
        <cat v-bind:name='name'></cat>
    </div>
</body>
<script>
    var app = new Vue({
        el: "#app",
        data: {
            'name': 'Tom'
        },
        components: {
            'panda': {
                template: `<div style="color:blue">熊猫来自 {{here}}</div>`,
                props: ['here']
            },
            'cat': {
                template: `<div style="color:blue">猫的名字是 {{name}}</div>`,
                props: ['name']
            }
        }
    })
</script>

</html>